package cn.personal.study.domain.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import cn.personal.study.domain.dto.response.QueryUserResponseDTO;

/**
 * TODO 〈一句话功能简述〉
 *
 * @author duliurui
 * @since 1.2.0
 */
public class UserRowMapper implements RowMapper<QueryUserResponseDTO> {

    @Override
    public QueryUserResponseDTO mapRow(ResultSet rs, int rowNum) throws SQLException {
        QueryUserResponseDTO user = new QueryUserResponseDTO();
        user.setId(rs.getString("id"));
        user.setName(rs.getString("name"));
        user.setAge(rs.getInt("age"));
        user.setRemark(rs.getString("remark"));
        return user;
    }
}
